package tests.ioTests;

import java.io.*;

public class StreamTests implements Serializable{
	final static String bin = "test.bin";

	public static void main(String[] args) {
		try {
			byte[] bytes = {1, 2, 3, 4, 5, 6};
			FileOutputStream outputStream = new FileOutputStream(bin);
			outputStream.write(bytes);
			outputStream.close();
			FileInputStream inputStream = new FileInputStream(bin);
			while (true) {
				int read = inputStream.read();
				if (read == -1) break;
				System.out.println(read + " ");
			}
		} catch (IOException e) {
			System.out.println(e.getMessage());
		}
	}
}